<?php echo $this->element("libs/tabsActive");?>
<script type="text/javascript">
$(function() {
    //$("ul#navigation li").size();
    $("ul#navigation li.accordion-group").each(function(x){
        $(this).find("a").first().attr("href","#submenu" + x);
        $(this).find("ul.collapse").first().attr("id","submenu" + x);
    });
    $('li.accordion-group').eq(tabx).addClass(function(){
        $(this).addClass('active');
        $(this).find("ul.collapse").addClass("in");
        //$(this).find("ul.collapse").find('li').addClass("active");
        var urlx = window.location.pathname;
       // console.log(urlx);
        $('a[href="'+ urlx +'"]').parent().addClass('active');
    });
});
</script>
<div class="sidebar-content">
    <!-- START Sidebar Menu -->
    <nav id="nav" class="accordion">
        <ul id="navigation">
            <!-- START Menu Divider -->
            <li class="divider">Chức năng</li>
            <!--/ END Menu Divider -->
            <!-- START Menu -->
            <li class="accordion-group">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-list"></span>
                    <span class="text">Quản lý bài viết</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse">
                    <li class=""><?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Chuyên mục bài viết",array('plugin'=>false,"controller"=>"catenews","action"=>"index"),array("class"=>" ","escape"=>false));?></li>
                    <li class=""><?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Danh sách bài viết",array('plugin'=>false,"controller"=>"news","action"=>"index"),array("class"=>" ","escape"=>false));?></li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Thêm chuyên mục",array('plugin'=>false,"controller"=>"catenews","action"=>"add"),array("class"=>" ","escape"=>false));?>
                    </li>
                   <li> <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Thêm bài viết",array('plugin'=>false,"controller"=>"news","action"=>"add"),array("class"=>" ","escape"=>false));?>

                    </li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-th-list"></span>
                    <span class="text">Dịch vụ</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse ">
                    <li class=""><a href="form-elements.html"><span class="icon icone-angle-right"></span> Elements</a></li>
                    <li class=""><a href="form-layouts.html"><span class="icon icone-angle-right"></span> Layouts</a></li>
                    <li class=""><a href="form-validation.html"><span class="icon icone-angle-right"></span> Validation</a></li>
                    <li class=""><a href="form-wizard.html"><span class="icon icone-angle-right"></span> Wizard</a></li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-file"></span>
                    <span class="text">Page Sample</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse">
                    <li>
                        <a data-toggle="collapse" data-parent="#level4" href="#submenu41">
                            <span class="icon icone-angle-right"></span>
                            <span class="text">Error</span>
                            <span class="label label-inverse">4</span>
                        </a>
                        <!-- START Submenu Menu -->
                        <ul  class="collapse" id="submenu41">
                            <li><a href="page-error403.html"><span class="icon icone-angle-right"></span> 403 page</a></li>
                            <li><a href="page-error404.html"><span class="icon icone-angle-right"></span> 404 page</a></li>
                            <li><a href="page-error500.html"><span class="icon icone-angle-right"></span> 500 page</a></li>
                            <li><a href="page-error503.html"><span class="icon icone-angle-right"></span> 503 page</a></li>
                        </ul>
                        <!--/ END Submenu Menu -->
                    </li>
                    <li>
                        <a href="page-login.html">
                            <span class="icon icone-angle-right"></span>
                            <span class="text">Login / register</span>
                        </a>
                    </li>
                    <li>
                        <a href="page-blank.html">
                            <span class="icon icone-angle-right"></span>
                            <span class="text">Blank / starter</span>
                        </a>
                    </li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-table"></span>
                    <span class="text">Tables</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse">
                    <li class=""><a href="table-static.html"><span class="icon icone-angle-right"></span> Static</a></li>
                    <li class=""><a href="table-dynamic.html"><span class="icon icone-angle-right"></span> Dynamic</a></li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group ">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-list-alt"></span>
                    <span class="text">Widget / Module</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse ">
                    <li class=""><a href="widget-default.html"><span class="icon icone-angle-right"></span> Default</a></li>
                    <li class=""><a href="widget-draggable.html"><span class="icon icone-angle-right"></span> Draggable</a></li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group ">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-user"></span>
                    <span class="text">Người dùng</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse">
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Người dùng",array('plugin'=>false,'controller'=>'users','action'=>'index'),array('escape'=>false));?>
                    </li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Phân quyền người dùng",array('plugin'=>'acl','controller'=>'aros','action'=>'user_permissions'),array('escape'=>false));?>
                    </li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Nhóm người dùng",array('plugin'=>false,'controller'=>'groups','action'=>'index'),array('escape'=>false));?>
                    </li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Phân quyền nhóm người dùng",array('plugin'=>'acl','controller'=>'aros','action'=>'role_permissions'),array('escape'=>false));?>
                    </li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->

            <!-- START Menu -->
            <li class="accordion-group ">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-cogs"></span>
                    <span class="text">Cài đặt chung</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse">
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Website",array('plugin'=>false,'controller'=>'commons','action'=>'index'),array('escape'=>false));?>
                    </li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Meta",array('plugin'=>'acl','controller'=>'commons','action'=>'user_permissions'),array('escape'=>false));?>
                    </li>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>Ngôn ngữ",array('plugin'=>false,'controller'=>'commons','action'=>'index'),array('escape'=>false));?>
                    </li>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->


            <!-- START Menu -->
            <li class="accordion-group ">
                <a data-toggle="collapse" data-parent="#navigation">
                    <span class="icon icone-sitemap"></span>
                    <span class="text">Menu</span>
                    <span class="arrow icone-caret-down"></span>
                </a>
                <!-- START Submenu Menu -->
                <ul class="collapse ">
                    <?php foreach ($list_menus as $key => $value):?>
                    <li class="">
                        <?php echo $this->Html->link("<span class=\"icon icone-angle-right\"></span>".$value['Menu']['name'],array('plugin'=>false,'controller'=>'menuitems','action'=>'index',$value['Menu']['id']),array('escape'=>false));?>
                    </li>
                <?php endforeach;?>
                </ul>
                <!--/ END Submenu Menu -->
            </li>
            <!--/ END Menu -->
        </ul>
    </nav>
    <!--/ END Sidebar Menu -->
</div>